#include <iostream>
#include <string>
#include <codecvt>

using namespace std;

using convertutf8 = codecvt_utf8<wchar_t >;

int main(int argc, char** argv){

    string narrowString = "世界，你好";
    cout << "narrowString's length: " << narrowString.length() << endl;
    cout << narrowString << endl;

	wstring name = L"世界，你好";
	cout << "name's length: " << name.length() << endl;
	wcout.imbue(locale("zh_CN"));
	wcout << name << endl;

    const wchar_t* rawData = name.c_str();
	cout << "the length of name's c_str is: " << wcslen(rawData) << endl;

	wstring_convert<convertutf8, wchar_t > converter;
	string bytes = converter.to_bytes(name);
    cout << "bytes: " << bytes << ", and length: " << bytes.length() << endl;
	cout << "================= end =================" << endl;
	return 0;
}
